]> dgit.raspbian.org Git - gnome-shell.git/commit
Array: add capability to insert while keeping a specific order
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 17 Dec 2011 22:52:11 +0000 (23:52 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 19 Dec 2011 15:54:46 +0000 (16:54 +0100)
commit09ab13cf04c7a5826b54cbbb66ca9aca8568a8dc
tree3297e11408b38691eca4a596b5399b74e92fc4ae
parent56f312dc03a84a11cfb67a4a63128b0ed03766e3
Array: add capability to insert while keeping a specific order

Adds two new functions, Util.lowerBound and Util.insertSorted,
that take an array, a value and a comparator, and find the
first position at which the value can be inserted without
violating the order, in optimal time.

https://bugzilla.gnome.org/show_bug.cgi?id=666429
js/misc/util.js
tests/Makefile.am
tests/unit/insertSorted.js [new file with mode: 0644]